<?php
  
 /**
  * @package JooS
  * @subpackage Syntax_PHPackager
  */

  require_once "JooS/Syntax/Complex/Transition.php";

  class JooS_Syntax_PHPackager_Relations_By_Version extends JooS_Syntax_Complex_Transition {
    /**
     * @return string
     */
    public function compile() {
      $ret = parent::compile();
      if ($ret !== false) {
        $ret = "\$this->getRelationByVersion(\"" . implode("\", \"", array(
          $this->getParsedValue(0),
          $this->getParsedValue(2), 
          $this->getParsedValue(4), 
        )) . "\")";
      }
      return $ret;
    }

    /**
     * @return JooS_Syntax_Complex_Concatenate
     */
    protected function createRule() {
      return $this->createSyntax("Complex_Concatenate", array(
        $this->createSyntax("Complex_Concatenate", array(
          $this->createSyntax("PHPackager_DOM_Name"), 
        )), 
        $this->createSyntax("Common_WhiteSpace"), 
        $this->createSyntax("Complex_Choose", array(
          $this->createSyntax("Simple_Symbol", "=="), 
          $this->createSyntax("Simple_Symbol", "<="), 
          $this->createSyntax("Simple_Symbol", "<"), 
          $this->createSyntax("Simple_Symbol", ">="), 
          $this->createSyntax("Simple_Symbol", ">"), 
        )), 
        $this->createSyntax("Common_WhiteSpace"), 
        $this->createSyntax("PHPackager_DOM_Version")
      ));
    }
  }
